unit IPTools;

interface

uses wwDBGrid;

function  wwDBGridStateToStr( DBGrid: TwwDBGrid ): string;
procedure StrTowwDBGridState( DBGrid: TwwDBGrid; var s: string );


implementation

uses DBTools, StrTools;

function  wwDBGridStateToStr( DBGrid: TwwDBGrid ): string;
begin
  with DBGrid do
    if UseTFields then
      result := DatasetFieldsStateToStr(DataSource.DataSet)
    else
      result := StrToQuotedStr(Selected.Text);
end;

procedure StrTowwDBGridState( DBGrid: TwwDBGrid; var s: string );
  var e:integer; 
begin
  DBGrid.Selected.Text := QuotedStrToStr(GetParam(',',s),e);
  DBGrid.ApplySelected;
end;


end.
